<?php
namespace App\Http\Controllers\Customer;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cookie;
class UserInfoController extends Controller
{

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function customer_info_change(Request $request)
    {
        $user_id = Cookie::get('user_id');
        $corp_id = Cookie::get('corp_id');
        $user_name = Cookie::get('user_name');
        $password = Cookie::get('password');

        $corpInfo = DB::table('corp_master')->where('corp_id','=',$corp_id)->first();
        $shopList = DB::table('shop_master')->where('corp_id','=',$corp_id)->get();
        $staffList = DB::table('staff_master')->where('corp_id','=',$corp_id)->get();
        return view('customer.customer_info_change', array(
            'user_name' => $user_name,
            'password' => $password,
            'corpInfo' => $corpInfo,
            'staffList' => $staffList,
            'shopList' => $shopList,
        )); // 返回视图
    }

}